//
//  TableViewCollectionCell.m
//  HarmonizePub
//
//  Created by rzhy on 2016/11/1.
//  Copyright © 2016年 Zy. All rights reserved.
//

#import "TableViewCollectionCell.h"
#import "Config.h"

@interface TableViewCollectionCell ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *labelYLayoutConstraint;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imageXLayoutConstraint;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *labelLayoutConstraint;

@end

@implementation TableViewCollectionCell

+ (NSString *)registerName {
    return @"TableViewCollectionCell";
}

- (void)awakeFromNib {
    [super awakeFromNib];
    if (iPhone6s) {
        self.imageXLayoutConstraint.constant = 10.0f;
    } else if (iPhone6P) {
        self.labelYLayoutConstraint.constant = 20.0f;
        self.imageXLayoutConstraint.constant = 20.0f;
        self.titleLabel.font = [UIFont systemFontOfSize:17.0f];
        self.labelLayoutConstraint.constant = 45.0f;
        self.subTitleLabel.font = [UIFont systemFontOfSize:15.0f];
    }
}

- (void)setCellShowDataDictionary:(NSDictionary *)dataDict {
    self.imageView.image = [UIImage imageNamed:dataDict[@"image"]];
    self.titleLabel.text = dataDict[@"title"];
    self.subTitleLabel.text = dataDict[@"subTitle"];
}

@end
